package win.demonlegion.common;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.integration.redis.util.RedisLockRegistry;
import org.springframework.stereotype.Component;

//@Component
public class CustomRedisLockRegistry {
    @Autowired
    private RedisConnectionFactory redisConnectionFactory;

    @Bean(destroyMethod = "destroy")
    public RedisLockRegistry getRedisLockRegistry() {
        return new RedisLockRegistry(redisConnectionFactory, "lock");
    }
}
